<template>
  <div class="home h100">
    <header>头部</header>

    <main>
      <router-view />
    </main>

    <footer>
      <router-link v-for="(item, index) in list"
                   :to="item.path"
                   active-class="active"
                   tag="span"
                   :key="index">
                   {{ item.title }}
      </router-link>
    </footer>
  </div>
</template>

<script>
export default {
  name: "Home",
  data() {
    return {
      list: [
        {
          path: "/home/homes",
          title: "首页",
        },
        {
          path: "/home/list",
          title: "列表",
        },
        {
          path: "/home/my",
          title: "我的",
        },
      ],
    };
  },
};
</script>

<style scoped>
.home {
  display: flex;
  flex-direction: column;
}

.home header {
  height: 46px;
  text-align: center;
}

.home main {
  flex: 1;
  overflow: auto;
}

.home footer {
  height: 46px;
  text-align: center;
  display: flex;
}

footer > span {
  flex: 1;
} 

.active {
  color: red;
}
</style>
